package com.bourne.util;

import com.bourne.constant.StringConstant;
import com.bourne.enums.BizCodeEnum;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

/**
 * @author bourne
 * @Title: InterceptorUtil
 * @Description:
 * @date 2021/12/3110:22
 */
@Slf4j
public class InterceptorUtil {

    /**
     * 获取token信息
     * @param request
     * @return
     */
    public static String getLoginToke(HttpServletRequest request) {
        String accessToken = request.getHeader(StringConstant.TOKEN);
        if (StringUtils.isBlank(accessToken)){
            accessToken = request.getParameter(StringConstant.TOKEN);
        }
        return accessToken;
    }
}
